﻿using System;
using System.ServiceModel;
using System.ServiceModel.Description;

namespace RockBus.ServiceModel
{
    public interface IClientBase<TContract> : IDisposable
        where TContract : class
    {
        Guid ClientId { get; }

        TContract Contract { get; }

        IClientChannel InnerChannel { get; }

        ChannelFactory<TContract> ChannelFactory { get; }

        ServiceEndpoint Endpoint { get; }

        ClientCredentials ClientCredentials { get; }

        CommunicationState State { get; }

        void Open();

        void Close();

        void Abort();

        event EventHandler Faulted;
    }
}